Xbasic
INET::SFTPReceiveFile Method
Syntax
.ReceiveFile as L (SourceFile as C, TargetFile as C)
Arguments
- SourceFileCharacter
The file to receive from the server.
- TargetFileCharacter
The target file name.
Returns
- resultLogical
Returns .t. if the operation succeed. Otherwise, returns .f.. If an error occurred, the INET::SFTP CallResult property will contain more information.
Description
Receives a file from the server. Contents are transferred as binary.
Example
dim ftp as INET::SFTP sftp.UserName = "Fred" sftp.Password = "Secret" sftp.ServerHost = "ftp.myserver.com" if sftp.ReceiveFile("/downloads/myData.csv","\temp\target.csv") <> .t. ' error msg = sftp.callResult.error ... end if